package com.yqg.protection.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yqg.protection.cover.InspectionStateConverter;
import com.yqg.protection.cover.LocalDateTimeConverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * record_inspection 实体类
 *
 * @author 小宇
 * @since 2024-09-13
 */
@Getter
@Setter
@TableName("record_inspection")
@ApiModel(value = "RecordInspection对象", description = "巡检记录")
public class RecordInspection implements Serializable {

    private static final long serialVersionUID = 1L;

    @ExcelProperty(value = "ID", index = 0)
    @ApiModelProperty("自增id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ExcelProperty(value = "单位ID", index = 1)
    @ApiModelProperty("单位id")
    private Long clientId;

    @ExcelProperty(value = "单位名称", index = 2)
    @TableField(exist = false)
    @ApiModelProperty("单位名称")
    private String clientName;

    @ExcelProperty(value = "巡检人员名称", index = 3)
    @ApiModelProperty("巡检人员名称")
    private String userName;

    @ExcelProperty(value = "巡检地址ID", index = 4)
    @ApiModelProperty("巡检地址ID")
    private Long address;

    @ExcelProperty(value = "巡检地址", index = 5)
    @TableField(exist = false)
    @ApiModelProperty("巡检地址")
    private String addrName;

    @ExcelProperty(value = "巡检电话", index = 6)
    @ApiModelProperty("巡检电话")
    private String telephone;

    @ExcelProperty(value = "巡检时间", index = 7, converter = LocalDateTimeConverter.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty("巡检时间")
    private LocalDateTime dateTime;

    @ExcelProperty(value = "巡检状态", index = 8, converter = InspectionStateConverter.class)
    @ApiModelProperty("巡检状态 0：无隐患 1有隐患 2已排除")
    private String state;

    @ExcelProperty(value = "巡检信息", index = 9)
    @ApiModelProperty("巡检信息")
    private String information;

    @ExcelProperty(value = "问题简述", index = 10)
    @ApiModelProperty("问题简述")
    private String hiddenDanger;

    @ExcelProperty(value = "巡检图片", index = 11)
    @ApiModelProperty("巡检图片")
    private String informationPhoto;

    @ExcelProperty(value = "检查时间", index = 12, converter = LocalDateTimeConverter.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty("检查时间")
    private LocalDateTime resultTime;

    @ExcelProperty(value = "检查结果", index = 13)
    @ApiModelProperty("检查结果")
    private String result;

    @ExcelProperty(value = "检查图片", index = 14)
    @ApiModelProperty("检查图片")
    private String resultPhoto;

    @ExcelProperty(value = "单位电话", index = 15)
    @TableField(exist = false)
    @ApiModelProperty("单位电话")
    private String clientTelephone;

    @ExcelIgnore
    private Integer isDelete;
}
